package cn.tedu.spring.eg1;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

//@Controller
//@Repository
//@Service
@Component
public class product {
    @Value("苹果")
    private String title;
    @Value("12")
    private int num;
//    @Value("又大又红")
    private String comment;

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public String getComment() {
        return comment;
    }
    @Value("又大又红")
    public void setComment(String comment) {
        this.comment = comment;
    }

    @Override
    public String toString() {
        return "product{" +
                "title='" + title + '\'' +
                ", num=" + num +
                ", comment='" + comment + '\'' +
                '}';
    }
}
